#!/usr/bin/env node

(async () => {
    const { Transform } = require('stream');
    const chalk = (await import('chalk')).default;
    
    
    class ColorTransform extends Transform {
      constructor(options) {
        super(options);
      }
    
    
      _transform(chunk, encoding, callback) {
        const coloredText = chalk.blueBright(chunk.toString());
        this.push(coloredText);
        callback();
      }
    }
    
    const colorTransform = new ColorTransform();
    
    
    process.stdin
      .pipe(colorTransform) 
      .pipe(process.stdout);
    
    console.log('请输入文本，输入的文本将以蓝色显示在控制台:');
})();


